package cn.cvs.servlet;

import cn.cvs.entity.EdocEntry;
import cn.cvs.service.EdocEntryService;
import cn.cvs.service.impl.EdocEntryServiceImpl;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @auth 吴阳基
 * @date 2024/1/4 11:42
 */
@WebServlet(urlPatterns = "/listName")
public class listNameServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        response.setContentType("text/html,charset=utf-8");
        EdocEntryService cardService = new EdocEntryServiceImpl();
        int id = Integer.parseInt(request.getParameter("id"));
        List<EdocEntry> list = cardService.listName(id);
        request.setAttribute("list", list);
        request.getRequestDispatcher("listName.jsp").forward(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }
}
